//添加事件监听
export const addEvent = (el, type, fn) => {
  if(el.addEventListener){
    el.addEventListener(type, fn, false)
  }else if(el.attachEvent){
    el.attachEvent('on'+type, function (){
      fn.call(el)
    })
  } else {
    el['on'+type] = fn
  }
}
export const removeEvent = (obj, type, fn) =>{
  if(obj.removeEventListener){
    obj.removeEventListener(type, fn, false)
  }else if(obj.deleteEvent){
    obj.deleteEvent('on'+type, fn)
  }else {
    obj['on'+type] = null
  }
}
